<#import "/spring.ftl" as spring />
<#macro basePath><#if springMacroRequestContext.getContextPath()=="/"><#else>${springMacroRequestContext.getContextPath()}</#if></#macro>
<#global ctx><@basePath/></#global>
<#global res>${ctx}/resources</#global>
<#global res_black>${ctx}/res_black</#global>
<#global img>${res}/images</#global>
<#global js>${res}/js</#global>
<#global css>${res}/css</#global>

<link rel="stylesheet" type="text/css" href="${js}/jquery-easyui-1.3.6/themes/bootstrap/easyui.css"/>
<link rel="stylesheet" type="text/css" href="${js}/jquery-easyui-1.3.6/themes/icon.css"/>

<link rel="stylesheet" type="text/css" href="${css}/styles.css"/>
<link rel="stylesheet" type="text/css" href="${js}/yixun/css/yixun.css"/>
<link rel="stylesheet" type="text/css" href="${css}/common.css"/>
<link rel="stylesheet" type="text/css" href="${css}/common.css"/>

<link rel="stylesheet" type="text/css" href="${res_black}/css/admin.css"/>
<link rel="stylesheet" type="text/css" href="${res_black}/css/layout.css"/>
<link rel="stylesheet" type="text/css" href="${res_black}/css/common.css"/>


<script type="text/javascript" src="${js}/jquery-easyui-1.3.6/jquery.min.js"></script>
<script type="text/javascript" src="${js}/jquery-easyui-1.3.6/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${js}/jquery-easyui-1.3.6/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" charset="utf-8" src="${js}/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="${js}/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" src="${js}/ajaxfileupload.js"></script>
<script type="text/javascript" src="${js}/jquery.json-2.2.js"></script>
<@setStatic alias="enumUtil" className="com.yixun.common.utils.EnumUtil"/>

<script type="text/javascript">
    var yixun_ctx = '${ctx}';
	var yixun_categorys = ${enumUtil.loadCommonCategorysStr()};
</script>
<script type="text/javascript" src="${js}/yixun/yixun-0.2.js"></script>
<script type="text/javascript">
    $(function(){
    	if(window.parent&&window.parent!=self){
    		window.parent.resizeIframe(self);
    	}
    	imgHover();
    });
    if(window.parent&&window.parent!=self){
    	document.writeln('<style>body{margin:0px 30px;}.panel-header{border-top-width:0px;}.panel-body{border:none;}</style>')
    }
    
      function formatImg(value, row, index) {
		return "<img showbig src='"+ value + "' width='25px' height='25px' />";
	}
	//图片放大
	var mbigshow;
	function imgHover(data){
		if(data){
			yixun.closeProgress();
		}
    	$('img[showbig]').hover(function(e){
			if(!$(this).attr('src')){return;}
			e = window.event||e;	
			var x=e.pageX;
		    var y=e.pageY;
		    if(mbigshow){
		    	mbigshow.css({top:(y+5)+'px',left:(x+5)+'px'});
		    }else{
		    	mbigshow = $('<img src="'+$(this).attr('src')+'" style="z-index:99999;position:absolute;top:'+(y+5)+'px;left:'+(x+5)+'px;width:320px;" bigshow/>').appendTo($(document.body));
		    }
		},function(e){
			mbigshow.remove();
			mbigshow = false;
		});
		return true;
	}
    //图片上传
	function uploadImg(obj) {
		var parent = $(obj).parent();
		$.ajaxFileUpload ({
			url:'${ctx}/qfbao/common/uploadFile?type=1',
			//url:'http://localhost:8081/qiaofangbao-img/api/uploadFile.api?type=1',
			secureuri:false,
			fileElementId:obj.id,
			dataType: 'json',
			success: function (data, status) {
				yixun.closeProgress();
				if(data.result=="1"){
					parent.find("input[type='hidden']").val(data.url);
					parent.find("img").attr("src",data.url).show();
				}else{
					 $.messager.show({
						title:'YiXun助手',
						msg:'上传图片失败！'
					 });
				}
			},
			error: function (data, status, e)            //相当于java中catch语句块的用法
	         {
	         	 yixun.closeProgress();
				 $.messager.show({
						title:'YiXun助手',
						msg:'网络连接失败！'
				});
	         }
		});
	}
   
</script>
<script type="text/javascript" src="${res_black}/js/common.js"></script>

